<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>返回所有 GeoIP 数据库类型的详细信息</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.geoip-db-get-all-info" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">geoip_db_get_all_info</h1>
  <p class="verinfo">(PECL geoip &gt;= 1.0.1)</p><p class="refpurpose"><span class="refname">geoip_db_get_all_info</span> &mdash; <span class="dc-title">返回所有 GeoIP 数据库类型的详细信息</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.geoip-db-get-all-info-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>geoip_db_get_all_info</strong></span>
    ( <span class="methodparam">void</span>
   ) : <span class="type">array</span></div>


  <p class="para rdfs-comment">
   <span class="function"><strong>geoip_db_get_all_info()</strong></span> 函数将会返回包含所有 GeoIP 数据库类型详细信息的多维数组
  </p>
  <p class="para">
   即使没有安装数据库，这个函数依旧可用。它将会列出数据库是否可用。
  </p>
  <p class="para">
   返回的关联数组，各键值所代表的含义如下：
  </p>
  <p class="para">
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      &quot;available&quot; -- 布尔值, 表示数据库是否可用(请参考
      <span class="function"><a href="geoip_db_avail.html" class="function">geoip_db_avail()</a></span>)
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      &quot;description&quot; -- 数据库的描述
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      &quot;filename&quot; -- 磁盘上的数据库文件名(请参考
      <span class="function"><a href="geoip_db_filename.html" class="function">geoip_db_filename()</a></span>)
     </span>
    </li>
   </ul>
  </p>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.geoip-db-get-all-info-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回一个关联数组。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.geoip-db-get-all-info-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4490">
    <p><strong>Example #1  <span class="function"><strong>geoip_db_get_all_info()</strong></span> 使用范例：</strong></p>
    <div class="example-contents"><p>
     以下代码将会打印包含所有信息的数组。
    </p></div>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$infos&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">geoip_db_get_all_info</span><span style="color: #007700">();<br />if&nbsp;(</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$infos</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$infos</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
array(11) {
  [1]=&gt;
  array(3) {
    [&quot;available&quot;]=&gt;
    bool(true)
    [&quot;description&quot;]=&gt;
    string(21) &quot;GeoIP Country Edition&quot;
    [&quot;filename&quot;]=&gt;
    string(32) &quot;/usr/share/GeoIP/GeoIP.dat&quot;
  }

[ ... ]

  [11]=&gt;
  array(3) {
    [&quot;available&quot;]=&gt;
    bool(false)
    [&quot;description&quot;]=&gt;
    string(25) &quot;GeoIP Domain Name Edition&quot;
    [&quot;filename&quot;]=&gt;
    string(38) &quot;/usr/share/GeoIP/GeoIPDomain.dat&quot;
  }
}
</pre></div>
    </div>
   </div>
  </p>

<p class="para">
   <div class="example" id="example-4491">
    <p><strong>Example #2  <span class="function"><strong>geoip_db_get_all_info()</strong></span> 使用范例：</strong></p>
    <div class="example-contents"><p>
     你可以使用不同的常量作为键来获取部分信息。
    </p></div>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$infos&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">geoip_db_get_all_info</span><span style="color: #007700">();<br />if&nbsp;(</span><span style="color: #0000BB">$infos</span><span style="color: #007700">[</span><span style="color: #0000BB">GEOIP_COUNTRY_EDITION</span><span style="color: #007700">][</span><span style="color: #DD0000">'available'</span><span style="color: #007700">])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$infos</span><span style="color: #007700">[</span><span style="color: #0000BB">GEOIP_COUNTRY_EDITION</span><span style="color: #007700">][</span><span style="color: #DD0000">'description'</span><span style="color: #007700">];<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
GeoIP Country Edition
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div></div></div></body></html>